home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6167 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: newsbf02.news.aol.com!not-for-mail
  2. From: ericburke@aol.com (Eric Burke)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Q: Any reason not to dump C in favour of C++ ?
  5. Date: 10 Feb 1996 21:17:25 -0500
  6. Organization: America Online, Inc. (1-800-827-6364)
  7. Sender: root@newsbf02.news.aol.com
  8. Message-ID: <4fjjjl$mer@newsbf02.news.aol.com>
  9. References: <4fgiht$gh5@gidora.kralizec.net.au>
  10. NNTP-Posting-Host: newsbf02.mail.aol.com
  11. X-Newsreader: AOL Offline Reader
  12.  
  13. In article <4fgiht$gh5@gidora.kralizec.net.au>, rosko@zeta.org.au (Ross
  14. McKay) writes:
  15.  
  16. >The question is because we want to revamp our in-house code libraries
  17. >with more new classes / types, and I would prefer to keep it all in
  18. >C++ so that any structures are proper objects, not just structs with
  19. >associated functions. 
  20. >
  21. >Can anyone give me a good reason why not to convert our C-only structs
  22. >to C++ (i.e. given that we have C++, and currently only code in C++,
  23. >will we ever find a need to use C over C++) ?
  24. >
  25. >
  26.  
  27. A good reason not to switch...your existing code (presumably) works, and
  28. you run the risk of breaking it if you change it.
  29.  
  30. Have you considered writing C++ classes which form a "facade" to your
  31. C structs and functions, which are safely hidden from the rest of the 
  32. application?  This will allow you to provide a more OO public interface,
  33. while preserving your legacy C code behind the scenes.  If the C functions
  34.  
  35. and structs are hidden behind this interface, you can gradually replace
  36. the 
  37. C library over time.
  38.  
  39.  
  40. Eric Burke
  41. ericburke@aol.com
  42.